<template>
  <div class="dash">

    <el-row class="dash-container" :gutter="20" style="margin: 30px 10px">
      <el-col :span="24">
        <div class="container-wrapper">
          <h1 class="hello">欢迎你，{{ getRoleText }}{{ $store.state.userData.tuserName }}！</h1>
        </div>
      </el-col>
    </el-row>

    <el-row :gutter="20" style="margin:30px 10px">
      <el-col :span="12">
        <div class="grid-content bg-purple userTotal">
          <div class="grid-content-item userCount">
            <div class="toUser" @click="$router.push('/admin/announcement')">
              <div class="el-icon-tickets userIcon"></div>
              <div class="userNum">
                <span></span>
                <br/>社区公告
              </div>
            </div>
          </div>

          <div class="grid-content-item userCount">
            <div class="toUser" @click="$router.push('/admin/activity')" style="background: #1A7BB9">
              <div class="el-icon-ship userIcon"></div>
              <div class="userNum">
                <span></span>
                <br/>娱乐活动
              </div>
            </div>
          </div>

          <div class="grid-content-item userCount">
            <div class="toUser" @click="$router.push('/admin/comment')" style="background: #ffa172">
              <div class="el-icon-chat-dot-square userIcon"></div>
              <div class="userNum">
                <span></span>
                <br/>居民留言
              </div>
            </div>
          </div>
        </div>
      </el-col>

      <el-col :span="12">
        <div class="grid-content bg-purple userTotal">
          <div class="grid-content-item userCount">
            <div class="toUser" @click="$router.push('/admin/visit-record')">
              <div class="el-icon-s-custom userIcon"></div>
              <div class="userNum">
                <span></span>
                <br/>随访记录
              </div>
            </div>
          </div>

          <div class="grid-content-item userCount">
            <div class="toUser" @click="$router.push('/admin/medical-service')" style="background: #1A7BB9">
              <div class="el-icon-s-custom userIcon"></div>
              <div class="userNum">
                <span></span>
                <br/>就诊记录
              </div>
            </div>
          </div>

          <div v-if="$store.state.userData.role == '2'" class="grid-content-item userCount">
            <div class="toUser" @click="$router.push('/admin/work-place')" style="background: #ffa172">
              <div class="el-icon-s-custom userIcon"></div>
              <div class="userNum">
                <span></span>
                <br/>工作区域
              </div>
            </div>
          </div>
        </div>
      </el-col>
    </el-row>

  </div>
</template>

<script>
export default {
  name: "Dash",
  data() {
    return {}
  },
  computed: {
    getRoleText() {
      return this.$store.state.userData.role == '1' ? '工作人员' : '管理员';
    }
  },
  methods: {},
  created() {

  }
};
</script>

<style>
.echarts {
  width: 100%;
  height: 100%;
}
</style>
<style lang="less" scoped>
@import "../../assets/less/base.less";

.dash {

  .dash-container {

    .container-wrapper {
      border-radius: 8px;
      min-height: 36px;
      background: white;
      height: 200px;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      padding-left: 72px;

      .hello {
        font-size: 48px;
      }
    }
  }


  .userTotal {
    height: 200px;
  }


  .userTotal .grid-content-item {
    // width: 50%;
    float: left;
    height: 200px;
    box-sizing: border-box;
  }

  .userCount {
    padding: 20px;
    width: 33.3%;

    .toUser {
      cursor: pointer;
    }

    & > div {
      background: @greenColor;
      height: 100%;
      border-radius: 5px;

      div {
        text-align: center;
        color: white;
      }

      .userIcon {
        width: 100%;
        text-align: center;
        font-size: 60px;
        line-height: 90px;
      }

      .userNum {
        span {
          font-size: 22px;
        }
      }
    }
  }

  .el-col {
    border-radius: 4px;
  }

  .bg-purple {
    background: white;
  }

  .grid-content {
    border-radius: 8px;
    min-height: 36px;
  }
}
</style>